package com.yeyks.common.em;

/**
 * @author fuchangshuai
 * @date 2019/06/04 13:31
 */
public enum RoomDeviceEnum {
    INTERNET("Internet", "宽带WIFI"),
    BREAKFAST("Breakfast", "早餐"),
    WINDOW("Window", "窗户"),
    RECEIVING("Receiving", "接机服务"),
    SWIMMING("Swimming", "游泳池"),
    PARKING("Parking", "免费停车"),
    ELECTRICKETTLE("ElectricKettle", "电热水壶");

    String value;
    String desc;

    RoomDeviceEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String value() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static String getDesc(String value) {
        RoomDeviceEnum[] roomDeviceEnums = values();
        for (RoomDeviceEnum roomDeviceEnum : roomDeviceEnums) {
            if (roomDeviceEnum.value().equals(value)) {
                return roomDeviceEnum.desc();
            }
        }
        return null;
    }

    public static String getValue(String desc) {
        RoomDeviceEnum[] roomDeviceEnums = values();
        for (RoomDeviceEnum roomDeviceEnum : roomDeviceEnums) {
            if (roomDeviceEnum.desc().equals(desc)) {
                return roomDeviceEnum.value();
            }
        }
        return null;
    }
}
